package com.sjzl.service;

import java.io.File;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sjzl.dto.UserDto;
import com.sjzl.entity.User;

/**
 * 用户模块
 * @author 黄健
 *
 */
public interface UserService extends BaseService<User>{
	/**
	 * 检查登陆，当用户开始访问站点时检查cookie中是否有用户的信息，有则将该用户信息存入session中
	 * @param request
	 * @param response
	 */
	public void checkLogin(HttpServletRequest request, HttpServletResponse response);
	
	/**
	 * 用户登陆
	 * @param userDto
	 * @param timeout
	 * @param request
	 * @param response
	 * @return
	 * @throws Exception
	 */
	public boolean login(UserDto userDto, Integer timeout, HttpServletRequest request, HttpServletResponse response);
	
	/**
	 * 注销
	 * @param request
	 * @param response
	 */
	public void logout(HttpServletRequest request, HttpServletResponse response);
	/**
	 * 根据账户名和密码获取用户信息
	 * @param account
	 * @param password
	 * @return
	 */
	public User getUser(String account, String password);
	/**
	 * 根据账户名获取用户信息
	 * @param account
	 * @return
	 */
	public User getUserByAccount(String account);
	
	/**
	 * 记录用户最后一次活动结束时时间
	 * @param account
	 */
	public void saveDateLastActived(String account);
	
	/**
	 * 记录用户最后一次活动结束时时间
	 * @param account
	 */
	public void saveDateLastActived(User user);
	
	/**
	 * 更新会员积分
	 */
	public boolean updateIntegral();
	
	public void updateUserInfo(User user ,File upload,String uploadFileName,String uploadContentType);
	
}
